package team.fivez.defaultmanage.enums;
//响应请求的枚举类，包装了响应码和响应信息
/**
 * Result message enum
 */
public enum ResultEnum {
    UNKNOWN_ERROR(-1, "An unknown error"),
    SUCCESS(0, "Success"),
    HOST_OFFLINE(100, "The remote host is not online"),
    HOST_HAS_ADDED(101, "Host duplicated"),
    HOST_NOT_ADDED(102, "Host does not exist"),
    JOB_ID_NOTFOUND(103, "The job id does not exist"),
    JOB_MAX(104, "Exceeded the maximum number of tasks"),
    JSON_NOT_FOUND(105, "The json file cannot be found"),
    ACCOUNT_HAS_ADDED(106, "Account added"),
    ACCOUNT_NOT_ADDED(107, "Account not added"),
    FORMAT_ERROR(108, "The text format uploaded by the user is wrong"),
    JOB_IS_RUNNING(109, "The job is running"),
    QUERY_ERROR(110, "The query is wrong"),
    JOB_COMPLETE(111, "Job accomplished"),
    COLLECTION_NAME_ERROR(112, "The table name wrong"),
    INDEX_ERROR(113, "Index error"),
    JOB_HAS_ADDED(114, "Job duplicated"),
    FILE_IS_NOT_EXIST(115, "userId file don't exist"),
    EXCEL_NUM_TOO_MANY(116, "Sorry, The excel row can't more than 65536, you should change file type");

    private final int code;
    private final String message;

    ResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
